<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改密码')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-user-resetPwd">
			<input name="userId"  type="hidden"  th:value="${user.userId}" />
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">用户名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" readonly="true" name="loginName" th:value="${user.loginName}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">旧密码：</label>
				<div class="col-sm-8">
					<input class="form-control" type="password" name="oldPassword" id="old-password" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">新密码：</label>
				<div class="col-sm-8">
					<input class="form-control" type="password" name="newPassword" id="new-password" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">重复新密码：</label>
				<div class="col-sm-8">
					<input class="form-control" type="password" name="repPassword" id="rep-password" required>
				</div>
			</div>
		</form>
	</div>
	<div class="row" style="color:red;font-size: smaller;margin-left: 20%;">
		<div class="col-sm-10">
			密码规则：
			密码长度位8—30位，必须包含大小写字母与数字和至少一个特殊字符（! @ # $ % ^ & * _ ~）
		</div>
	</div>
	<div class="row">
		<div class="col-sm-offset-5 col-sm-10">
			<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
			<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		$("#form-user-resetPwd").validate({
			rules:{
				password:{
					required:true,
					minlength: 5,
					maxlength: 20
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(ctx + "system/user/resetPwd", $('#form-user-resetPwd').serialize());
	        }
	    }
	</script>
</body>

</html>
